package com.xoa.controller.equipment;


import com.xoa.model.equipment.DataTree;
import com.xoa.model.equipment.LimsEquipOwnerlog;
import com.xoa.service.equipment.EquipmentTransferService;
import com.xoa.util.LimsJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("equipTransfer")
public class EquipmentTransferController {

    /**
     *
     * @作者 庞君
     * @创建日期 17:12 2019/10/10 0010
     * @类介绍 映射路径
     *
     */
    @RequestMapping("/portabilityApplication")
    public String portabilityApplication(){
        return "/app/equipment/equipmentTransform/portabilityApplication";
    }

    /**
     *
     * @作者 庞君
     * @创建日期 14:24 2019/10/11 0011
     * @类介绍 新增页面映射
     *
     */
    @RequestMapping("/addTransfer")
    public String addTransfer(){
        return "/app/equipment/equipmentTransform/addTransfer";
    }
    //设备转移管理页面映射
    @RequestMapping("/index")
    public String index(){
        return "/app/equipment/equipmentTransformManagement/index";
    }
    //设备接收页面映射
    @RequestMapping("/equipResive")
    public String equipResive(){
        return "/app/equipment/equipmentTransformManagement/equipResive";
    }
    /**
     *
     * @作者 庞君
     * @创建日期 14:24 2019/10/12 0012
     * @类介绍 新增页面选择设备映射
     *
     */
    @RequestMapping("/selectEquip")
    public String selectEquip(){
        return "/app/equipment/equipmentTransform/selectEquip";
    }

    @Autowired
    private EquipmentTransferService equipmentTransferService;

    @RequestMapping("selectBypid")
    @ResponseBody
    public LimsJson selectBypid(Integer pid){
        return equipmentTransferService.selectBypid(pid);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   15:18 2019/10/10 0010
    * 方法介绍:   获取当前登录人所在的结算组织和登录人
    * 参数说明:   No such property: code for class: Script1
    * @return     [request]
    */
    @RequestMapping("userDept")
    @ResponseBody
    public LimsJson UserDept(HttpServletRequest request){
        return equipmentTransferService.deptExpp(request);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   14:45 2019/10/11 0011
    * 方法介绍:   选择设备时设备列表查询
    * 参数说明:   No such property: code for class: Script1
    * @return     [equipTypeId, page, limit]
    */
        @RequestMapping("equiplists")
    @ResponseBody
    public LimsJson EquipLists(Integer equipTypeId,Integer page,Integer limit,Integer deptId){
        return equipmentTransferService.findequipBydept(equipTypeId,page,limit,deptId);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   8:44 2019/10/15 0015
    * 方法介绍:   新增设备转移申请
    * 参数说明:   No such property: code for class: Script1
    * @return     [ownerLog, ownerList, ownerlogId]
    */
    @ResponseBody
    @RequestMapping("addTransAppr")
    public LimsJson addTransAppr(LimsEquipOwnerlog limsEquipOwnerlog, String ownerList, Integer logId){
        return equipmentTransferService.addTransAppr(limsEquipOwnerlog,ownerList,logId);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   14:44 2019/10/11 0011
    * 方法介绍:   添加设备时检验
    * 参数说明:   No such property: code for class: Script1
    * @return     [request, equipIds]
    */
    @ResponseBody
    @RequestMapping("checkChooseEquip")
    public LimsJson checkChooseEquip(HttpServletRequest request,String  equipIds){
        return equipmentTransferService.checkChooseEquip(request,equipIds);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   14:44 2019/10/11 0011
    * 方法介绍:   根据状态查询当前登录人的申请信息
    * 参数说明:   No such property: code for class: Script1
    * @return     [page, limit, approvalStatus, receiveStatus]
    */
    @ResponseBody
    @RequestMapping("selectOwnerLog")
    public LimsJson selectOwnerLog(Integer page,Integer limit,String approvalStatus,String column,String inptext){
        return equipmentTransferService.selectOwnerLog(page,limit,approvalStatus,column,inptext);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   14:43 2019/10/11 0011
    * 方法介绍:   删除设备信息
    * 参数说明:   No such property: code for class: Script1
    * @return     [ids]
    */
    @ResponseBody
    @RequestMapping("delByKey")
    public LimsJson delByKey(String ids){
        return equipmentTransferService.delByKey(ids);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   14:45 2019/10/11 0011
    * 方法介绍:   删除申请信息
    * 参数说明:   No such property: code for class: Script1
    * @return     [logIds]
    */
    @ResponseBody
    @RequestMapping("delBylogId")
    public LimsJson delBylogId(String logIds){
        return equipmentTransferService.delBylogId(logIds);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   15:21 2019/10/11 0011
    * 方法介绍:   申请提交
    * 参数说明:   No such property: code for class: Script1
    * @return     [approvalStatus, logIds]
    */
    @ResponseBody
    @RequestMapping("updStatus")
    public LimsJson updStatus(String approvalStatus,String recUser,String logIds,String  deptIds){
        return equipmentTransferService.updStatus(approvalStatus,recUser,logIds,deptIds);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   13:32 2019/10/12 0012
    * 方法介绍:   设备接收
    * 参数说明:   No such property: code for class: Script1
    * @return     [ownerlogId, logIds, ownerlistId, receiveStatus, newPositionId, newPositionName, memo]
    */
    @ResponseBody
    @RequestMapping("updRecStatus")
    public LimsJson updRecStatus(Integer ownerlogId,Integer ownerlistId,String receiveStatus,String newPositionName){
        return equipmentTransferService.updRecStatus(ownerlogId,ownerlistId,receiveStatus,newPositionName);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   13:32 2019/10/12 0012
    * 方法介绍:   设备转移管理
    * 参数说明:   No such property: code for class: Script1
    * @return     [request, page, limit, approvalStatus]
    */
    @ResponseBody
    @RequestMapping("adminastorList")
    public LimsJson adminastorList(HttpServletRequest request,Integer page,Integer limit,String approvalStatus,String column,String inptext){
        return equipmentTransferService.adminastorList(request,page,limit,approvalStatus,column,inptext);
    }
    /**
     * 创建作者:   庞君
     * 创建日期:   13:32 2019/10/12 0012
     * 方法介绍:   设备接收(父类)
     * 参数说明:   No such property: code for class: Script1
     * @return     [request, page, limit, approvalStatus]
     */
    @ResponseBody
    @RequestMapping("reciviList")
    public List<DataTree> reciviList(HttpServletRequest request, Integer ownerlogId){
        return equipmentTransferService.reciviList(request,ownerlogId);
    }
    /**
     * 创建作者:   庞君
     * 创建日期:   13:32 2019/10/12 0012
     * 方法介绍:   设备转移子类
     * 参数说明:   No such property: code for class: Script1
     * @return     [request, page, limit, approvalStatus]
     */
    @ResponseBody
    @RequestMapping("reciviChilList")
    public LimsJson reciviChilList(Integer id){
        return equipmentTransferService.reciviChilList(id);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   13:58 2019/10/15 0015
    * 方法介绍:   查询设备信息
    * 参数说明:   No such property: code for class: Script1
    * @return     [page, limit, ownerlogId]
    */
    @ResponseBody
    @RequestMapping("findBylogId")
    public LimsJson findBylogId(Integer page, Integer limit, Integer ownerlogId){
        return equipmentTransferService.findBylogId(page,limit,ownerlogId);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   16:33 2019/10/15 0015
    * 方法介绍:   编辑数据回显
    * 参数说明:   No such property: code for class: Script1
    * @return     [ownerlogId]
    */
    @RequestMapping("editApprovalInfo")
    @ResponseBody
    public  LimsJson editApprovalInfo(Integer ownerlogId){
        return  equipmentTransferService.editApprovalInfo(ownerlogId);
    }
    /**
     * 创建作者:   庞君
     * 创建日期:   16:33 2019/10/15 0015
     * 方法介绍:   编辑数据回显
     * 参数说明:   No such property: code for class: Script1
     * @return     [ownerlogId]
     */
    @RequestMapping("editApproval")
    @ResponseBody
    public  LimsJson editApproval(LimsEquipOwnerlog limsEquipOwnerlog){
        return  equipmentTransferService.editApproval(limsEquipOwnerlog);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   13:12 2019/10/16 0016
    * 方法介绍:   设备接收列表接口
    * 参数说明:   No such property: code for class: Script1
    * @return     [request, page, limit, map]
    */
    @ResponseBody
    @RequestMapping("selectRceInfo")
    public  LimsJson selectRceInfo(HttpServletRequest request,Integer page,Integer limit,Map map,String column,String inptext){
        return equipmentTransferService.selectRceInfo(request,page,limit,map,column,inptext);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   16:00 2019/10/17 0017
    * 方法介绍:   新部门查询
    * 参数说明:   No such property: code for class: Script1
    * @return
    */
    @ResponseBody
    @RequestMapping("findRecDept")
    public  LimsJson findRecDept(HttpServletRequest request){
        return equipmentTransferService.findRecDept(request);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   18:58 2020/1/7
    * 方法介绍:   设备台账设备转移记录接口
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @ResponseBody
    @RequestMapping("transferData")
    public LimsJson transferData(HttpServletRequest request,Integer limit,Integer page, Integer equipId, java.sql.Date transferDate, String originalDeptId,
                                 String newDeptId, String approvalStatus, String receiveStatus, String workflowNo,String inptext,String column){
        return equipmentTransferService.transferData(request,limit,page,equipId,transferDate,originalDeptId,newDeptId,approvalStatus,receiveStatus,workflowNo,
                inptext,column);
    }
}
